home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -readerstuff- / matt_briggs / eac / developers / tutorials / tutorial_07.eac < prev    next >
Encoding:
Text File  |  1999-04-21  |  1.3 KB  |  43 lines

  1. .--------------------------------------------------------------------------.
  2. |  This example shows how it is possible ADD and SUBTRACT from variables.  |
  3. |   I have firstly declared a variable called `score', and have used the   |
  4. | commands ADD: and SUB: to change to scores value. Of course, the score   |
  5. |  can go up or down by more than one if you like, just change the value   |
  6. |  at the end of the variable and colon. i.e.  ADD:score:50 , Thus adding  |
  7. |               50 to the value of score. easy uh?                         |
  8. `--------------------------------------------------------------------------'
  9.  
  10. DEC:score=0
  11. NOBUSY:
  12. WINDOW:ENGiNE Adventure Code - by Matt Briggs - Nice.
  13.  
  14. .-------------------------------------.
  15. |  Set up our START page as usual...  |
  16. `-------------------------------------'
  17.  
  18. PAGE:START
  19. CLRTEXT:
  20. ADDTEXT:Score: 
  21. ADDVAR:score
  22. ADDOPT:Add to score:Add_One
  23. ADDOPT:Subtract from score:Sub_One
  24. ENDPAGE:
  25.  
  26. .------------------------------------.
  27. |  Add one to the value of score :)  |
  28. `------------------------------------'
  29.  
  30. PAGE:Add_One
  31. ADD:score:1
  32. GOTO:START
  33. ENDPAGE:
  34.  
  35. .--------------------------------------------.
  36. |  Subtract one from the value our score :(  |
  37. `--------------------------------------------'
  38.  
  39. PAGE:Sub_One
  40. SUB:score:1
  41. GOTO:START
  42. ENDPAGE:
  43.